Text compare attribute

Is it possible to use attribute dxl to compare the text of an attribute in the current module with the text of a different attribute in another module and return the Object ID's of the Objects with matching text?
Dave399 - Thu May 31 03:59:28 EDT 2012

Re: Text compare attribute
llandale - Thu May 31 12:51:09 EDT 2012

So for an oA in mA you want to see the IDs of all oBs in mB that have the same text as oA.

Having an attr-DXL search some entire other module is not realistic when the code is re-run repeatedly (for each object). Now I happed to have a similar chore here and have decided that instead of having the code run for EACH oA, it will run once for the first object, but set the value for EVERY oA. Thus, the code does not have "obj.attrDXLName". Now if the attr dxl runs and sets all the values, it won't run again while the module is open. We thus read the Text of all oB only once, not for each oA. Here's an outline.

//[1] Read current module B
Skip skpTextB = create  // key is raw Text in B; data is list of B ObjIs with that text
Open mB
for every oB
{  TextB = oB."Object Text"
   if (null TextB) then continue
   ObjListB = ""
   if (find(skpTextB, TextB, ObjListB)) then delete(skpTextB, TextB)
   if (length(ObjListB) > 0) then
   then ObjListB = ObjListB "," identifier(oB)
   else ObjListB = identifier(oB)
              // use Buffer instead...
   put(skpTextB, TextB, ObjListB)
}
//[2] Set mA values
for every oA
{  TextA = oA."Object Text"
   if (null TextA) then continue
   ObjListB = "."       // This is a key feature.  It sets oA to something other than null so the Attr DXL does not keep recalculating.
   find(skpTextB, TextA, ObjListB)
   oA.attrDXLName = ObjListB
}
delete(skpTextB)


This approach indeed violates some context-scope "rules" for Attr-DXL that I have embrased in the past.

-Louie